<template>
  <el-table-column :label="columns.label" :prop="columns.label" :align="center">
    <template v-for="(item, index) in columns.children">
      <tableColumn v-if="item.children && item.children.length" :key="index" :columns="item" />
      <el-table-column v-else :key="index" :label="item.label" :prop="item.prop" :align="center" />
    </template>
  </el-table-column>
</template>

<script>
export default {
  name: 'TableColumn',
  props: {
    columns: {
      type: Object,
      required: true,
    },
    center: {
      type: String,
      default: 'center',
    },
  },

};
</script>
